﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Drawing;

namespace ELab.Controls.flatstyle
{
    public class FlatPictureBox : PictureBox
    {
        public FlatPictureBox()
        {

        }

        private BorderDrawer borderDrawer = new BorderDrawer();
        protected override void OnPaint(PaintEventArgs pe)
        {
            base.OnPaint(pe);
            pe.Graphics.DrawRectangle(new Pen(BorderColor, 1), 0, 0, this.Width - 1, this.Height - 1);
        }

        /// <summary>
        /// Color of object's border
        /// </summary>
        public Color BorderColor
        {
            get { return borderDrawer.BorderColor; }
            set
            {
                borderDrawer.BorderColor = value;
                Invalidate();
            }
        }
    }
}
